package cz.fit.vutbr.pis2012.augeaswh.control.whman.slots;

import java.io.Serializable;
import java.util.List;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import cz.fit.vutbr.pis2012.augeaswh.persistence.Slot;

import cz.fit.vutbr.pis2012.augeaswh.managers.SlotsManager;

@ManagedBean
@SessionScoped
public class SlotsBean implements Serializable {
	private static final long serialVersionUID = 3264442299683233195L;
	@EJB
	private SlotsManager sm;
	private int page;
	private final int recordsPerPage;

	public SlotsBean() {
		this.page=1;
		this.recordsPerPage=15;
	}
	
	public List<Slot> getSlots() {
		return sm.getSlots();			
	}
	
	public String editSlot() {
		return "edit";
	}
	
	public int getPage() {
		return this.page;
	}
	
	public void setPage(int page) {
		this.page=page;
	}
	
	public int getRecordsPerPage() {
		return this.recordsPerPage;
	}
}